<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclbuffer.cpp -->
  <title>QCLBuffer Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLBuffer</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLBuffer Class Reference</h1>
<!-- $$$QCLBuffer-brief -->
<p>The QCLBuffer class represents an OpenCL buffer object. <a href="#details">More...</a></p>
<!-- @@@QCLBuffer -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLBuffer&gt;</pre><p>Inherits <a href="qclmemoryobject.html">QCLMemoryObject</a>.</p>
<p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qclbuffer-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#QCLBuffer">QCLBuffer</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#QCLBuffer-2">QCLBuffer</a></b> ( QCLContext * <i>context</i>, cl_mem <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#QCLBuffer-3">QCLBuffer</a></b> ( const QCLBuffer &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyTo">copyTo</a></b> ( size_t <i>offset</i>, size_t <i>size</i>, const QCLBuffer &amp; <i>dest</i>, size_t <i>destOffset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyTo-2">copyTo</a></b> ( size_t <i>offset</i>, const QCLImage2D &amp; <i>dest</i>, const QRect &amp; <i>rect</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyTo-3">copyTo</a></b> ( size_t <i>offset</i>, const QCLImage3D &amp; <i>dest</i>, const size_t[3] <i>origin</i>, const size_t[3] <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToAsync">copyToAsync</a></b> ( size_t <i>offset</i>, size_t <i>size</i>, const QCLBuffer &amp; <i>dest</i>, size_t <i>destOffset</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToAsync-2">copyToAsync</a></b> ( size_t <i>offset</i>, const QCLImage2D &amp; <i>dest</i>, const QRect &amp; <i>rect</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToAsync-3">copyToAsync</a></b> ( size_t <i>offset</i>, const QCLImage3D &amp; <i>dest</i>, const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToRect">copyToRect</a></b> ( const QRect &amp; <i>rect</i>, const QCLBuffer &amp; <i>dest</i>, const QPoint &amp; <i>destPoint</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>destBytesPerLine</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToRect-2">copyToRect</a></b> ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const QCLBuffer &amp; <i>dest</i>, const size_t[3] <i>destOrigin</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>destBytesPerLine</i>, size_t <i>destBytesPerSlice</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToRectAsync">copyToRectAsync</a></b> ( const QRect &amp; <i>rect</i>, const QCLBuffer &amp; <i>dest</i>, const QPoint &amp; <i>destPoint</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>destBytesPerLine</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#copyToRectAsync-2">copyToRectAsync</a></b> ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const QCLBuffer &amp; <i>dest</i>, const size_t[3] <i>destOrigin</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>destBytesPerLine</i>, size_t <i>destBytesPerSlice</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLBuffer </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#createSubBuffer">createSubBuffer</a></b> ( size_t <i>offset</i>, size_t <i>size</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void * </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#map">map</a></b> ( size_t <i>offset</i>, size_t <i>size</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void * </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#map-2">map</a></b> ( QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#mapAsync">mapAsync</a></b> ( void ** <i>ptr</i>, size_t <i>offset</i>, size_t <i>size</i>, QCLMemoryObject::Access <i>access</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> size_t </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#offset">offset</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLBuffer </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#parentBuffer">parentBuffer</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#read">read</a></b> ( size_t <i>offset</i>, void * <i>data</i>, size_t <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#read-2">read</a></b> ( void * <i>data</i>, size_t <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#readAsync">readAsync</a></b> ( size_t <i>offset</i>, void * <i>data</i>, size_t <i>size</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#readRect">readRect</a></b> ( const QRect &amp; <i>rect</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#readRect-2">readRect</a></b> ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#readRectAsync">readRectAsync</a></b> ( const QRect &amp; <i>rect</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#readRectAsync-2">readRectAsync</a></b> ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#write">write</a></b> ( const void * <i>data</i>, size_t <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#write-2">write</a></b> ( size_t <i>offset</i>, const void * <i>data</i>, size_t <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#writeAsync">writeAsync</a></b> ( size_t <i>offset</i>, const void * <i>data</i>, size_t <i>size</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#writeRect">writeRect</a></b> ( const QRect &amp; <i>rect</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#writeRect-2">writeRect</a></b> ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#writeRectAsync">writeRectAsync</a></b> ( const QRect &amp; <i>rect</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#writeRectAsync-2">writeRectAsync</a></b> ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i>, const QCLEventList &amp; <i>after</i> = QCLEventList() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLBuffer &amp; </td><td class="memItemRight bottomAlign"><b><a href="qclbuffer.html#operator-eq">operator=</a></b> ( const QCLBuffer &amp; <i>other</i> )</td></tr>
</table>
<ul>
<li class="fn">11 public functions inherited from <a href="qclmemoryobject.html#public-functions">QCLMemoryObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QCLBuffer-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLBuffer class represents an OpenCL buffer object.</p>
</div>
<p>See also <a href="qclvector.html">QCLVector</a>.</p>
<!-- @@@QCLBuffer -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLBuffer[overload1]$$$QCLBuffer -->
<h3 class="fn"><a name="QCLBuffer"></a>QCLBuffer::QCLBuffer ()</h3>
<p>Constructs a null OpenCL buffer object.</p>
<!-- @@@QCLBuffer -->
<!-- $$$QCLBuffer$$$QCLBufferQCLContext*cl_mem -->
<h3 class="fn"><a name="QCLBuffer-2"></a>QCLBuffer::QCLBuffer ( <a href="qclcontext.html">QCLContext</a> * <i>context</i>, cl_mem <i>id</i> )</h3>
<p>Constructs an OpenCL buffer object that is initialized with the native OpenCL identifier <i>id</i>, and associates it with <i>context</i>. This class will take over ownership of <i>id</i> and will release it in the destructor.</p>
<!-- @@@QCLBuffer -->
<!-- $$$QCLBuffer$$$QCLBufferconstQCLBuffer& -->
<h3 class="fn"><a name="QCLBuffer-3"></a>QCLBuffer::QCLBuffer ( const QCLBuffer &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QCLBuffer -->
<!-- $$$copyTo[overload1]$$$copyTosize_tsize_tconstQCLBuffer&size_t -->
<h3 class="fn"><a name="copyTo"></a>bool QCLBuffer::copyTo ( size_t <i>offset</i>, size_t <i>size</i>, const QCLBuffer &amp; <i>dest</i>, size_t <i>destOffset</i> )</h3>
<p>Copies the <i>size</i> bytes at <i>offset</i> in this buffer be copied to <i>destOffset</i> in the buffer <i>dest</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#copyToAsync">copyToAsync</a>().</p>
<!-- @@@copyTo -->
<!-- $$$copyTo$$$copyTosize_tconstQCLImage2D&constQRect& -->
<h3 class="fn"><a name="copyTo-2"></a>bool QCLBuffer::copyTo ( size_t <i>offset</i>, const <a href="qclimage2d.html">QCLImage2D</a> &amp; <i>dest</i>, const QRect &amp; <i>rect</i> )</h3>
<p>Copies the contents of this buffer, starting at <i>offset</i> to <i>rect</i> within <i>dest</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#copyToAsync">copyToAsync</a>().</p>
<!-- @@@copyTo -->
<!-- $$$copyTo$$$copyTosize_tconstQCLImage3D&constsize_t[3]constsize_t[3] -->
<h3 class="fn"><a name="copyTo-3"></a>bool QCLBuffer::copyTo ( size_t <i>offset</i>, const <a href="qclimage3d.html">QCLImage3D</a> &amp; <i>dest</i>, const size_t[3] <i>origin</i>, const size_t[3] <i>size</i> )</h3>
<p>Copies the contents of this buffer, starting at <i>offset</i> to <i>origin</i> within <i>dest</i>, extending for <i>size</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#copyToAsync">copyToAsync</a>().</p>
<!-- @@@copyTo -->
<!-- $$$copyToAsync[overload1]$$$copyToAsyncsize_tsize_tconstQCLBuffer&size_tconstQCLEventList& -->
<h3 class="fn"><a name="copyToAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::copyToAsync ( size_t <i>offset</i>, size_t <i>size</i>, const QCLBuffer &amp; <i>dest</i>, size_t <i>destOffset</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Requests that the <i>size</i> bytes at <i>offset</i> in this buffer be copied to <i>destOffset</i> in the buffer <i>dest</i>. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#copyTo">copyTo</a>().</p>
<!-- @@@copyToAsync -->
<!-- $$$copyToAsync$$$copyToAsyncsize_tconstQCLImage2D&constQRect&constQCLEventList& -->
<h3 class="fn"><a name="copyToAsync-2"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::copyToAsync ( size_t <i>offset</i>, const <a href="qclimage2d.html">QCLImage2D</a> &amp; <i>dest</i>, const QRect &amp; <i>rect</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Copies the contents of this buffer, starting at <i>offset</i> to <i>rect</i> within <i>dest</i>. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#copyTo">copyTo</a>().</p>
<!-- @@@copyToAsync -->
<!-- $$$copyToAsync$$$copyToAsyncsize_tconstQCLImage3D&constsize_t[3]constsize_t[3]constQCLEventList& -->
<h3 class="fn"><a name="copyToAsync-3"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::copyToAsync ( size_t <i>offset</i>, const <a href="qclimage3d.html">QCLImage3D</a> &amp; <i>dest</i>, const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Copies the contents of this buffer, starting at <i>offset</i> to <i>origin</i> within <i>dest</i>, extending for <i>size</i>. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#copyTo">copyTo</a>().</p>
<!-- @@@copyToAsync -->
<!-- $$$copyToRect[overload1]$$$copyToRectconstQRect&constQCLBuffer&constQPoint&size_tsize_t -->
<h3 class="fn"><a name="copyToRect"></a>bool QCLBuffer::copyToRect ( const QRect &amp; <i>rect</i>, const QCLBuffer &amp; <i>dest</i>, const QPoint &amp; <i>destPoint</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>destBytesPerLine</i> )</h3>
<p>Copies the contents of <i>rect</i> within this buffer to <i>dest</i>, starting at <i>destPoint</i>. The source and destination line pitch values are given by <i>bufferBytesPerLine</i> and <i>destBytesPerLine</i> respectively. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#copyToRectAsync">copyToRectAsync</a>().</p>
<!-- @@@copyToRect -->
<!-- $$$copyToRect$$$copyToRectconstsize_t[3]constsize_t[3]constQCLBuffer&constsize_t[3]size_tsize_tsize_tsize_t -->
<h3 class="fn"><a name="copyToRect-2"></a>bool QCLBuffer::copyToRect ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const QCLBuffer &amp; <i>dest</i>, const size_t[3] <i>destOrigin</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>destBytesPerLine</i>, size_t <i>destBytesPerSlice</i> )</h3>
<p>Copies the 3D rectangle defined by <i>origin</i> and <i>size</i> within this buffer to <i>destOrigin</i> within <i>dest</i>. The source and destination pitch values are given by <i>bufferBytesPerLine</i>, <i>bufferBytesPerSlice</i>, <i>destBytesPerLine</i>, and <i>destBytesPerSlice</i>. Returns true if the copy was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#copyToRectAsync">copyToRectAsync</a>().</p>
<!-- @@@copyToRect -->
<!-- $$$copyToRectAsync[overload1]$$$copyToRectAsyncconstQRect&constQCLBuffer&constQPoint&size_tsize_tconstQCLEventList& -->
<h3 class="fn"><a name="copyToRectAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::copyToRectAsync ( const QRect &amp; <i>rect</i>, const QCLBuffer &amp; <i>dest</i>, const QPoint &amp; <i>destPoint</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>destBytesPerLine</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Copies the contents of <i>rect</i> within this buffer to <i>dest</i>, starting at <i>destPoint</i>. The source and destination line pitch values are given by <i>bufferBytesPerLine</i> and <i>destBytesPerLine</i> respectively.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#copyToRect">copyToRect</a>().</p>
<!-- @@@copyToRectAsync -->
<!-- $$$copyToRectAsync$$$copyToRectAsyncconstsize_t[3]constsize_t[3]constQCLBuffer&constsize_t[3]size_tsize_tsize_tsize_tconstQCLEventList& -->
<h3 class="fn"><a name="copyToRectAsync-2"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::copyToRectAsync ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const QCLBuffer &amp; <i>dest</i>, const size_t[3] <i>destOrigin</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>destBytesPerLine</i>, size_t <i>destBytesPerSlice</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Copies the 3D rectangle defined by <i>origin</i> and <i>size</i> within this buffer to <i>destOrigin</i> within <i>dest</i>. The source and destination pitch values are given by <i>bufferBytesPerLine</i>, <i>bufferBytesPerSlice</i>, <i>destBytesPerLine</i>, and <i>destBytesPerSlice</i>.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#copyToRectAsync">copyToRectAsync</a>().</p>
<!-- @@@copyToRectAsync -->
<!-- $$$createSubBuffer[overload1]$$$createSubBuffersize_tsize_tQCLMemoryObject::Access -->
<h3 class="fn"><a name="createSubBuffer"></a>QCLBuffer QCLBuffer::createSubBuffer ( size_t <i>offset</i>, size_t <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates a new buffer that refers to the <i>size</i> bytes, starting at <i>offset</i> within this buffer. The data in the new buffer will be accessed according to <i>access</i>.</p>
<p>Sub-buffers are an OpenCL 1.1 feature. On OpenCL 1.0, this function will return a null buffer.</p>
<p>See also <a href="qclbuffer.html#parentBuffer">parentBuffer</a>() and <a href="qclbuffer.html#offset">offset</a>().</p>
<!-- @@@createSubBuffer -->
<!-- $$$map[overload1]$$$mapsize_tsize_tQCLMemoryObject::Access -->
<h3 class="fn"><a name="map"></a>void * QCLBuffer::map ( size_t <i>offset</i>, size_t <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Maps the <i>size</i> bytes starting at <i>offset</i> in this buffer into host memory for the specified <i>access</i> mode. Returns a pointer to the mapped region.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#mapAsync">mapAsync</a>() and <a href="qclmemoryobject.html#unmap">unmap</a>().</p>
<!-- @@@map -->
<!-- $$$map$$$mapQCLMemoryObject::Access -->
<h3 class="fn"><a name="map-2"></a>void * QCLBuffer::map ( <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>This is an overloaded function.</p>
<p>Maps the entire contents of this buffer into host memory for the specified <i>access</i> mode. Returns a pointer to the mapped region.</p>
<!-- @@@map -->
<!-- $$$mapAsync[overload1]$$$mapAsyncvoid**size_tsize_tQCLMemoryObject::AccessconstQCLEventList& -->
<h3 class="fn"><a name="mapAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::mapAsync ( void ** <i>ptr</i>, size_t <i>offset</i>, size_t <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Maps the <i>size</i> bytes starting at <i>offset</i> in this buffer into host memory for the specified <i>access</i> mode. Returns a pointer to the mapped region in <i>ptr</i>, which will be valid only after the request finishes.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#map">map</a>() and <a href="qclmemoryobject.html#unmapAsync">unmapAsync</a>().</p>
<!-- @@@mapAsync -->
<!-- $$$offset[overload1]$$$offset -->
<h3 class="fn"><a name="offset"></a>size_t QCLBuffer::offset () const</h3>
<p>Returns the offset of this buffer within its <a href="qclbuffer.html#parentBuffer">parentBuffer</a>() if it is a sub-buffer; zero otherwise.</p>
<p>See also <a href="qclbuffer.html#createSubBuffer">createSubBuffer</a>() and <a href="qclbuffer.html#parentBuffer">parentBuffer</a>().</p>
<!-- @@@offset -->
<!-- $$$parentBuffer[overload1]$$$parentBuffer -->
<h3 class="fn"><a name="parentBuffer"></a>QCLBuffer QCLBuffer::parentBuffer () const</h3>
<p>Returns the parent of this buffer if it is a sub-buffer; null otherwise.</p>
<p>See also <a href="qclbuffer.html#createSubBuffer">createSubBuffer</a>() and <a href="qclbuffer.html#offset">offset</a>().</p>
<!-- @@@parentBuffer -->
<!-- $$$read[overload1]$$$readsize_tvoid*size_t -->
<h3 class="fn"><a name="read"></a>bool QCLBuffer::read ( size_t <i>offset</i>, void * <i>data</i>, size_t <i>size</i> )</h3>
<p>Reads <i>size</i> bytes from this buffer, starting at <i>offset</i>, into the supplied <i>data</i> array. Returns true if the read was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#readAsync">readAsync</a>() and <a href="qclbuffer.html#write">write</a>().</p>
<!-- @@@read -->
<!-- $$$read$$$readvoid*size_t -->
<h3 class="fn"><a name="read-2"></a>bool QCLBuffer::read ( void * <i>data</i>, size_t <i>size</i> )</h3>
<p>This is an overloaded function.</p>
<p>Reads <i>size</i> bytes from this buffer, starting at offset zero, into the supplied <i>data</i> array. Returns true if the read was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#readAsync">readAsync</a>() and <a href="qclbuffer.html#write">write</a>().</p>
<!-- @@@read -->
<!-- $$$readAsync[overload1]$$$readAsyncsize_tvoid*size_tconstQCLEventList& -->
<h3 class="fn"><a name="readAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::readAsync ( size_t <i>offset</i>, void * <i>data</i>, size_t <i>size</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Reads <i>size</i> bytes from this buffer, starting at <i>offset</i>, into the supplied <i>data</i> array.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#read">read</a>() and <a href="qclbuffer.html#writeAsync">writeAsync</a>().</p>
<!-- @@@readAsync -->
<!-- $$$readRect[overload1]$$$readRectconstQRect&void*size_tsize_t -->
<h3 class="fn"><a name="readRect"></a>bool QCLBuffer::readRect ( const QRect &amp; <i>rect</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i> )</h3>
<p>Reads the bytes defined by <i>rect</i> and <i>bufferBytesPerLine</i> from this buffer into the supplied <i>data</i> array, with a line pitch of <i>hostBytesPerLine</i>. Returns true if the read was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#readRectAsync">readRectAsync</a>() and <a href="qclbuffer.html#writeRect">writeRect</a>().</p>
<!-- @@@readRect -->
<!-- $$$readRect$$$readRectconstsize_t[3]constsize_t[3]void*size_tsize_tsize_tsize_t -->
<h3 class="fn"><a name="readRect-2"></a>bool QCLBuffer::readRect ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i> )</h3>
<p>Reads the bytes in the 3D region defined by <i>origin</i>, <i>size</i>, <i>bufferBytesPerLine</i>, and <i>bufferBytesPerSlice</i> from this buffer into the supplied <i>data</i> array, with a line pitch of <i>hostBytesPerLine</i>, and a slice pitch of <i>hostBytesPerSlice</i>. Returns true if the read was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#readRectAsync">readRectAsync</a>() and <a href="qclbuffer.html#writeRect">writeRect</a>().</p>
<!-- @@@readRect -->
<!-- $$$readRectAsync[overload1]$$$readRectAsyncconstQRect&void*size_tsize_tconstQCLEventList& -->
<h3 class="fn"><a name="readRectAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::readRectAsync ( const QRect &amp; <i>rect</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Reads the bytes defined by <i>rect</i> and <i>bufferBytesPerLine</i> from this buffer into the supplied <i>data</i> array, with a line pitch of <i>hostBytesPerLine</i>.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#readRect">readRect</a>() and <a href="qclbuffer.html#writeRectAsync">writeRectAsync</a>().</p>
<!-- @@@readRectAsync -->
<!-- $$$readRectAsync$$$readRectAsyncconstsize_t[3]constsize_t[3]void*size_tsize_tsize_tsize_tconstQCLEventList& -->
<h3 class="fn"><a name="readRectAsync-2"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::readRectAsync ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Reads the bytes in the 3D region defined by <i>origin</i>, <i>size</i>, <i>bufferBytesPerLine</i>, and <i>bufferBytesPerSlice</i> from this buffer into the supplied <i>data</i> array, with a line pitch of <i>hostBytesPerLine</i>, and a slice pitch of <i>hostBytesPerSlice</i>.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#readRect">readRect</a>() and <a href="qclbuffer.html#writeRectAsync">writeRectAsync</a>().</p>
<!-- @@@readRectAsync -->
<!-- $$$write[overload1]$$$writeconstvoid*size_t -->
<h3 class="fn"><a name="write"></a>bool QCLBuffer::write ( const void * <i>data</i>, size_t <i>size</i> )</h3>
<p>Writes <i>size</i> bytes to this buffer, starting at offset zero, from the supplied <i>data</i> array. Returns true if the write was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#writeAsync">writeAsync</a>() and <a href="qclbuffer.html#read">read</a>().</p>
<!-- @@@write -->
<!-- $$$write$$$writesize_tconstvoid*size_t -->
<h3 class="fn"><a name="write-2"></a>bool QCLBuffer::write ( size_t <i>offset</i>, const void * <i>data</i>, size_t <i>size</i> )</h3>
<p>Writes <i>size</i> bytes to this buffer, starting at <i>offset</i>, from the supplied <i>data</i> array. Returns true if the write was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#writeAsync">writeAsync</a>() and <a href="qclbuffer.html#read">read</a>().</p>
<!-- @@@write -->
<!-- $$$writeAsync[overload1]$$$writeAsyncsize_tconstvoid*size_tconstQCLEventList& -->
<h3 class="fn"><a name="writeAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::writeAsync ( size_t <i>offset</i>, const void * <i>data</i>, size_t <i>size</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Writes <i>size</i> bytes to this buffer, starting at <i>offset</i>, from the supplied <i>data</i> array.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>See also <a href="qclbuffer.html#write">write</a>() and <a href="qclbuffer.html#readAsync">readAsync</a>().</p>
<!-- @@@writeAsync -->
<!-- $$$writeRect[overload1]$$$writeRectconstQRect&constvoid*size_tsize_t -->
<h3 class="fn"><a name="writeRect"></a>bool QCLBuffer::writeRect ( const QRect &amp; <i>rect</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i> )</h3>
<p>Writes the bytes at <i>data</i>, with a line pitch of <i>hostBytesPerLine</i> to the region of this buffer defined by <i>rect</i> and <i>bufferBytesPerLine</i>. Returns true if the write was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#writeRectAsync">writeRectAsync</a>() and <a href="qclbuffer.html#readRect">readRect</a>().</p>
<!-- @@@writeRect -->
<!-- $$$writeRect$$$writeRectconstsize_t[3]constsize_t[3]constvoid*size_tsize_tsize_tsize_t -->
<h3 class="fn"><a name="writeRect-2"></a>bool QCLBuffer::writeRect ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i> )</h3>
<p>Writes the bytes at <i>data</i>, with a line pitch of <i>hostBytesPerLine</i>, and a slice pitch of <i>hostBytesPerSlice</i>, to the 3D region defined by <i>origin</i>, <i>size</i>, <i>bufferBytesPerLine</i>, and <i>bufferBytesPerSlice</i> in this buffer. Returns true if the write was successful; false otherwise.</p>
<p>This function will block until the request finishes. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#writeRectAsync">writeRectAsync</a>() and <a href="qclbuffer.html#readRect">readRect</a>().</p>
<!-- @@@writeRect -->
<!-- $$$writeRectAsync[overload1]$$$writeRectAsyncconstQRect&constvoid*size_tsize_tconstQCLEventList& -->
<h3 class="fn"><a name="writeRectAsync"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::writeRectAsync ( const QRect &amp; <i>rect</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>hostBytesPerLine</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Writes the bytes at <i>data</i>, with a line pitch of <i>hostBytesPerLine</i> to the region of this buffer defined by <i>rect</i> and <i>bufferBytesPerLine</i>. Returns true if the write was successful; false otherwise.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#writeRect">writeRect</a>() and <a href="qclbuffer.html#readRectAsync">readRectAsync</a>().</p>
<!-- @@@writeRectAsync -->
<!-- $$$writeRectAsync$$$writeRectAsyncconstsize_t[3]constsize_t[3]constvoid*size_tsize_tsize_tsize_tconstQCLEventList& -->
<h3 class="fn"><a name="writeRectAsync-2"></a><a href="qclevent.html">QCLEvent</a> QCLBuffer::writeRectAsync ( const size_t[3] <i>origin</i>, const size_t[3] <i>size</i>, const void * <i>data</i>, size_t <i>bufferBytesPerLine</i>, size_t <i>bufferBytesPerSlice</i>, size_t <i>hostBytesPerLine</i>, size_t <i>hostBytesPerSlice</i>, const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>after</i> = QCLEventList() )</h3>
<p>Writes the bytes at <i>data</i>, with a line pitch of <i>hostBytesPerLine</i>, and a slice pitch of <i>hostBytesPerSlice</i>, to the 3D region defined by <i>origin</i>, <i>size</i>, <i>bufferBytesPerLine</i>, and <i>bufferBytesPerSlice</i> in this buffer.</p>
<p>This function will queue the request and return immediately. Returns an event object that can be used to wait for the request to finish.</p>
<p>The request will not start until all of the events in <i>after</i> have been signaled as finished. The request is executed on the active command queue for <a href="qclmemoryobject.html#context">context</a>().</p>
<p>This function is only supported in OpenCL 1.1 and higher.</p>
<p>See also <a href="qclbuffer.html#writeRect">writeRect</a>() and <a href="qclbuffer.html#readRectAsync">readRectAsync</a>().</p>
<!-- @@@writeRectAsync -->
<!-- $$$operator=[overload1]$$$operator=constQCLBuffer& -->
<h3 class="fn"><a name="operator-eq"></a>QCLBuffer &amp; QCLBuffer::operator= ( const QCLBuffer &amp; <i>other</i> )</h3>
<p>Assigns <i>other</i> to this object.</p>
<!-- @@@operator= -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
